//  区分打开页面的来源,再渲染页面
$(function() {
    let key = location.search.split('=')[0]
    let id = location.search.split('=')[1]
        // 通过搜索跳转的
    value = decodeURI(id)

    function load(obj) {
        $.ajax({
            type: 'get',
            url: BigNew.index_search,
            data: obj,
            success: function(backData) {
                if (backData.data.totalCount > 0) {
                    let atcStr = template('tpl-search', backData)
                    $('.left_con').html(atcStr)
                } else {
                    $('.left_con').html(`<div class="list_title">
                        <h3>暂无文章</h3>
                    </div>`)
                }
            }
        })
    }
    if (key == '?key') {
        load({
            key: value
        })
    } else if (key == '?catId') {
        //通过文章类别跳转的
        load({
            type: value
        })
    } else {
        //直接打开的
        load()
    }
})